Repository navigation
Conversation
The deferred restore added in fbde6a9 ran after every window size change, including the user's own, and snapped the panel back to the configured width/height about 0.1s later, so the panel could not be resized by dragging its divider or with enlarge/shrink-window. Record the frame size and the panel's total size whenever the panel is sized. When the restore runs and the panel's total size changed while the frame size did not, adopt the new size as the target instead of undoing it. Frame resizes and margin-only changes are still repaired as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks for the PR, I'll take a look later today
…On Fri, Nov 27, 2026 at 7:16 AM Luís Oliveira ***@***.***> wrote:
Problem
The AI session side panel can't be resized manually. Dragging its divider,
or using C-x { / C-x } / enlarge-window, works briefly, but about 0.1 s
later the panel snaps back to ai-code-backends-infra-window-width /
-height.
The cause is the deferred restore added in fbde6a9
<fbde6a9>.
It hooks window-size-change-functions, which runs after *every* size
change, including the user's own. Each change schedules
ai-code-backends-infra--restore-side-window-sizes, which refits the panel
to the configured size. Only the C-. / C-, grow/shrink commands could
change the size, because they update the target variable itself.
Fix
- Every time the package sizes a managed panel, it records the frame
size and the panel's total size as a window parameter.
- When the deferred restore runs, a change in the panel's total size
while the frame size stayed the same is treated as a manual resize. The
panel's current body width (left/right) or total height (top/bottom)
becomes the new target, the same way C-. / C-, update it.
- Frame resizes are still treated as layout drift and repaired, so the
space-recovery behavior from fbde6a9
<fbde6a9>
is kept.
- The comparison uses total size, not body size, so margin-only
changes are still repaired back to the configured body width.
Tests
- New tests in test/test_ai-code-backends-infra-window.el:
- a manual grow and shrink is adopted on all four sides and
survives later frame resizes;
- the deferred restore triggered by a manual resize doesn't undo it;
- a margin change is still repaired.
- deferred-restore-coalesces used to simulate layout drift with
window-resize, which now counts as a manual resize. It changes the
target width instead.
- display-buffer-in-side-window-uses-body-width passes a fake window
symbol, so it now stubs the new recording function.
- The full test suite has the same failures before and after this
change; they are unrelated to it (ghostel, gptel-agent, goose,
editor-viewport). Byte-compile and checkdoc are clean on the touched files.
- README: added a note next to the C-. / C-, docs.
------------------------------
You can view, comment on, or merge this pull request online at:
#617
Commit Summary
- 20debe2
<20debe2>
fix(infra): keep manual side window resizes
File Changes
(4 files <https://github.com/tninja/ai-code-interface.el/pull/617/files>)
- *M* README.org
<https://github.com/tninja/ai-code-interface.el/pull/617/files#diff-ecbc1aa90e9ff97a00b0b2aab1551bceee0c4d21993146bdcb1af4de31c9cac6>
(2)
- *M* ai-code-backends-infra.el
<https://github.com/tninja/ai-code-interface.el/pull/617/files#diff-fd4044cd40559e81be5dd45e61627b26391b37f28e0d7dcebc9e1799f17b56c7>
(51)
- *M* test/test_ai-code-backends-infra-window.el
<https://github.com/tninja/ai-code-interface.el/pull/617/files#diff-b9717779d00e250233f8dfb30e6e22ab3e9676d3c0c68f0fa25ff782043cbced>
(50)
- *M* test/test_ai-code-backends-infra.el
<https://github.com/tninja/ai-code-interface.el/pull/617/files#diff-3e838fdb4dbcd9d7a7ed9383f0a768e8e201fab9bbc47602a1b879ef4230a2ad>
(2)
Patch Links:
- https://github.com/tninja/ai-code-interface.el/pull/617.patch
- https://github.com/tninja/ai-code-interface.el/pull/617.diff
—
Reply to this email directly, view it on GitHub
<#617?email_source=notifications&email_token=AAFOPAI7SXFZJEBJZMMWF6D53GLENA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TKMRYHE3TGOJYGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFOPANDCDS5ZLWCEVLX7XD53GLENAVCNFSNUABGKJSXA33TNF2G64TZHMYTAMRSGQYDSMZRGI5US43TOVSTWNRWGQ4TEMBQGE4DNILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AAFOPAPUR3CY6VER5ZDNI6T53GLENA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TKMRYHE3TGOJYGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/AAFOPAJI3DVTTIXY4FJSGMD53GLENA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42TKMRYHE3TGOJYGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The AI session side panel can't be resized manually. Dragging its divider, or using
C-x {/C-x }/enlarge-window, works briefly, but about 0.1 s later the panel snaps back toai-code-backends-infra-window-width/-height.The cause is the deferred restore added in fbde6a9. It hooks
window-size-change-functions, which runs after every size change, including the user's own. Each change schedulesai-code-backends-infra--restore-side-window-sizes, which refits the panel to the configured size. Only theC-./C-,grow/shrink commands could change the size, because they update the target variable itself.Fix
C-./C-,update it.Tests
test/test_ai-code-backends-infra-window.el:deferred-restore-coalescesused to simulate layout drift withwindow-resize, which now counts as a manual resize. It changes the target width instead.display-buffer-in-side-window-uses-body-widthpasses a fake window symbol, so it now stubs the new recording function.C-./C-,docs.